<?php

namespace Xrfg\Api\Trading\Spot\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Xrfg\Core\Trading\Spot\Models\Order;

class TradeIndexRequest extends FormRequest
{
    /**
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * @return array
     */
    public function rules()
    {
        return [
            'symbol' => ['nullable'],
            'side' => ['nullable', Rule::in([Order::SIDE_BUY, Order::SIDE_SELL])],
            'start_time' => ['nullable', 'date'],
            'end_time' => ['nullable', 'date'],
            'per_page' => ['nullable', 'integer', 'max:100'],
        ];
    }
}
